﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace TD
{
    /// <summary>
    /// 防御塔
    /// </summary>
    public class MessageBarHelper : Microsoft.Xna.Framework.DrawableGameComponent
    {
        Game DefaultGame;

#if DEBUG
        public static int FrameCount = 0;
        public static int DrawCount = 0;
#endif
        SpriteFont DefaultFont;
        public MessageBarHelper(Game game)
            : base(game)
        {
            DefaultGame = game;
        }

  
        public override void Update(GameTime gameTime)
        {
            FrameCount++;
            base.Update(gameTime);
        }

        protected override void LoadContent()
        {
            DefaultFont = DefaultGame.Content.Load<SpriteFont>("宋体");
            base.LoadContent();
        }

        public override void Draw(GameTime gameTime)
        {
            DrawCount++;
            TDGame.spriteBatch.Begin();
#if DEBUG
            TDGame.spriteBatch.DrawString(DefaultFont, FrameCount + "/" + DrawCount + " Frames", new Vector2(DefaultGame.Window.ClientBounds.Width - 200, DefaultGame.Window.ClientBounds.Height - 50), Color.Red);
#endif
            TDGame.spriteBatch.End();
            base.Draw(gameTime);
        }
    }

}